package com.seadragon.app.dms.model;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "DRIVER")
public class Driver extends Resident {
	/**
	 * 
	 */
	private static final long serialVersionUID = -26930593303645797L;

	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = IDENTITY)
	private long id;

	@OneToMany(mappedBy = "driver", cascade=CascadeType.PERSIST)
	private List<License> licenses;

	@Column(name = "DRIVING_AGE")
	private int drivingAge;

	@Column(name = "USERNAME")
	private String userName;

	@Column(name = "PASSWORD")
	private String password;

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public List<License> getLicenses() {
		return licenses;
	}

	public void setLicenses(List<License> licenses) {
		this.licenses = licenses;
	}

	public int getDrivingAge() {
		return drivingAge;
	}

	public void setDrivingAge(int drivingAge) {
		this.drivingAge = drivingAge;
	}
}
